class Solution {
public:
    bool row[9][10];
    bool col[9][10];
    bool arr[3][3][10];
    bool isValidSudoku(vector<vector<char>>& board) {
        for (int i = 0;i < 9;i++)
        {
            for (int j = 0;j < 9;j++)
            {
                if (board[i][j] != '.')
                {
                    if (row[i][board[i][j] - '0'] || col[j][board[i][j] - '0'] || arr[i / 3][j / 3][board[i][j] - '0'])
                    {
                        return false;
                    }
                    row[i][board[i][j] - '0'] = true;col[j][board[i][j] - '0'] = true;arr[i / 3][j / 3][board[i][j] - '0'] = true;
                }
            }
        }
        return true;




    }
};